package br.eng.eliseu.gwt.gestaoWeb.server.command.generico;

import br.eng.eliseu.gwt.gestaoWeb.model.BaseEntity;
import br.eng.eliseu.gwt.gestaoWeb.server.command.BaseCommand;

import com.google.inject.persist.Transactional;

public class SaveEntityCommand extends BaseCommand<BaseEntity>/*implements Callable<BaseEntity>*/ {

	private static final long serialVersionUID = -3798211423265897903L;
//	@Inject	EntityManager em;
	
	private BaseEntity baseEntity;
	
	@Transactional
	public BaseEntity call() {
		baseEntity = getEntityManager().merge(baseEntity); 
		return baseEntity;
	}

	public BaseEntity getBaseEntity() {
		return baseEntity;
	}

	public void setBaseEntity(BaseEntity baseEntity) {
		this.baseEntity = baseEntity;
	}

}
